<template>
	<view class="layouttab">
		<!-- 渲染顶部tab切换 -->
		<view @click="handleindex(index)" v-for="(item,index) in tablist" :key="item.id" >
			<view  :class="clickindex==index?'action':''">{{item.title}}</view>
		</view>
	
	</view>
	<Tuijian v-if="clickindex==0"></Tuijian>
</template>

<script>
	import Tuijian from '../../views/index_tabpages/Tuijian/Tuijian.vue';
	
	
export default{
	components:{
		Tuijian
	},
	props:{
		tablist:{
			type:Array,
			default:[]
		},
		
	},
	data(){
		return{
			clickindex:0
		}
	},
	methods:{
		handleindex(index){
			this.clickindex=index
	
		}	
	}
	
}


	
	
</script>

<style>
	.layouttab{
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 0 30rpx;
	}
	/* 高亮样式 */
	.action{
		color: red;
		border-bottom: 10rpx solid red;
	}
	       
</style>
